import Vue from 'vue'
import VueRouter from 'vue-router'
//页面
import Index from '@/pages/index'
import TheThink from '@/pages/TheThink'
import TheWant from '@/pages/TheWant'
import TheLook from '@/pages/TheLook'
import Aboutus from '@/pages/aboutus'
import Callus from '@/pages/callus'
import Listen from '@/pages/listen'
import More from '@/pages/more'
import Vlogo from '@/pages/Vlogo'
import DevelopmentHistory from '@/pages/developmentHistory'
import RivacyProtection from '@/pages/rivacyProtection'
import Play from '@/pages/play'
import Test from '@/pages/test'
import Add from '@/pages/Add'
import Picture from '@/pages/pictures'
Vue.use(VueRouter)

export default new VueRouter({
  mode:'history',
  routes: [
    {
      path: '',
      redirect:"Index"
    },
    {
      path: '/index',
      name: 'index',
      component: Index,
      children:[
                {
                  path: '/TheThink',
                  name: '所思',
                  component: TheThink
                      
                },
                {
                  path: '/TheLook',
                  name: '所见',
                  component: TheLook
                  
                },
                {
                  path: '/TheWant',
                  name: '所想',
                  component: TheWant
                  }
                ]
    },  
    {
      path: '/aboutus',
      name: '关于我们',
      component: Aboutus
    },  
    {
      path: '/callus',
      name: '联系我们',
      component: Callus
    },  
    {
      path: '/listen',
      name: '在线听歌',
      component: Listen
    },  
    {
      path: '/more',
      name: '更多',
      component: More
    },
    {
      path: '/vlogo',
      name: 'vlogo',
      component: Vlogo
    },  
    {
      path: '/developmentHistory',
      name: '发展历程',
      component: DevelopmentHistory
    },  
    {
      path: '/rivacyProtection',
      name: '隐私保护',
      component: RivacyProtection
    },  
    {
      path: '/picture',
      name: '照片墙',
      component: Picture
    },  
    {
      path: '/test',
      name: '测试',
      component: Test
    },  
    {
      path: '/add',
      name: '添加诗歌',
      component: Add
    },  
    {
      path: '/picture',
      name: '照片墙',
      component: Picture
    }
  ]
})
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}
